# -*- encoding:utf-8 -*-
import datetime
import os

import service.cubeinfo.crcrunner as cubeinfo
import service.sharerank.srcrunner as sharerank
import service.stockdebate.sdcrunner as stockdebate
import service.stocknews.sncrunner as stocknews
import service.stockprice.spcrunner as stockprice

__author__ = 'shudong.msd'


# 开始更新
filepath = u'G:/毕业设计/数据/排行榜/'+str(datetime.date.today())+'.xls'

# 更新排行榜
sharerank.updateDB()
sharerank.updateDB_hot_asc()
os.remove(filepath)
sharerank.writeToExcel(filepath)

# 更新价格
stockprice.updateDB()

# 更新组合
cubeinfo.update_cube_name()
cubeinfo.updateDBWithRank()
cubeinfo.updateDBWithInfo()
cubeinfo.writeStockGroupForCube()

# 更新新闻
stocknews.write_sina_news()
stocknews.write_east_news()

# 更新股吧博客
stockdebate.write_debate_to_db()
stockdebate.write_east_debate_to_db()

